<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="org.springframework.security.core.Authentication" %>
<%@ page import="org.springframework.security.core.context.SecurityContextHolder" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8">
	<title><spring:message code="label.title" /></title>
</head>
<body>

<a href="<c:url value="/" />">
	<spring:message code="label.title" />
</a><br/>

<%
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
%>
<% if (auth != null && !auth.getName().equals("guest")) { %>
	<%= auth.getName() %>
	<%= auth.getAuthorities().iterator().next().toString()%>
	<a href="<c:url value="/logout" />"> <spring:message
			code="label.logout" /> </a>
<% } else {%>
	<a href="<c:url value="/login.jsp" />"> <spring:message
			code="label.login" /> </a>
<%}%>
